package com.twu.biblioteca;

import java.util.ArrayList;

public class Customer {
    Integer customerId;
    String customerName;
    String libraryNumber;
    String password;
    public Customer(Integer customerId,String customerName,String libraryNumber,String password){
        this.customerId=customerId;
        this.customerName = customerName;
        this.libraryNumber = libraryNumber;
        this.password = password;
    }

    @Override
    public String toString() {
        return customerName;
    }
   private static ArrayList<Customer> listOfCustomers = new ArrayList<Customer>();

    public static Customer returnCustomerObjectGivenCustomerName(String customerName){
        for(Customer thisCustomer : listOfCustomers){
            if(thisCustomer.customerName == customerName){
                return thisCustomer;
            }
        }
        return null;
    }
}
